﻿using CoachingOrganizer.ClientInfrastructure.ServicesEntities.LocalStorage.Tools.MoodLevel;
using CoachingOrganizer.Logic.Common;
using CoachingOrganizer.Logic.Models.Tools.MoodLevel;
using CoachingOrganizer.Toolkit.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoachingOrganizer.Logic.Logic.Tools.MoodLevel
{
    internal class MoodValueLogic
    {
        private readonly MoodValueModel _model;
        private readonly LogicExtender _logicExtender;
        private readonly MoodLevelLogic _upperLogic;
        private readonly IMoodValueInfo _localData;

        public MoodValueModel Model
        {
            get { return _model; }
        }

        public IMoodValueInfo LocalData
        {
            get { return _localData; }
        }

        public MoodValueLogic(MoodValueModel model, LogicExtender logicExtender, MoodLevelLogic upperLogic, IMoodValueInfo localData)
        {
            _model = model;
            _logicExtender = logicExtender;
            _upperLogic = upperLogic;
            _localData = localData;
            model.SaveDelegate = Save;
        }

        private ActionResult Save()
        {
            _localData.Time = _model.Time;
            _localData.Value = _model.Value;
            return _localData.Save();
        }
    }
}
